home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / cenviw1.zip / WINEXEC.LIB < prev    next >
Text File  |  1993-06-25  |  2KB  |  33 lines

  1. // WinExec.lib - Cmm code wrapper for the WinExec function.  This library
  2. //               can be included in your source file to provide access to
  3. //               to Windows' WinExec() function.
  4. // FUNCTION: WinExec()
  5. // SYNTAX: WinExec(CommandLine[,WindowState])
  6. //   CommandLine: String for the command line, wich is the program name to execute
  7. //                followed possibly by optional paramters.
  8. //   WindowState: How to display window (if non-Windows the PIF determines
  9. //                show state).  If not supplied then defaults to SW_SHOWNORMAL.
  10. //                Must be one of the following:
  11.       #define SW_HIDE             0 // Hides the window
  12.       #define SW_SHOWNORMAL       1 // Activate and display at original size and position
  13.       #define SW_SHOWMINIMIZED    2 // Activate and display as an icon
  14.       #define SW_SHOWMAXIMIZED    3 // Activate and display maximized
  15.       #define SW_SHOWNOACTIVATE   4 // Display normal size, but do not make active
  16.       #define SW_SHOW             5 // Activate in current size and position
  17.       #define SW_MINIMIZE         6 // minimize, then active top-window in task list
  18.       #define SW_SHOWMINNOACTIVE  7 // show iconic, do not activate
  19.       #define SW_SHOWNA           8 // show, current active window remains active
  20.       #define SW_RESTORE          9 // same as SW_SHOWNORMAL
  21. // RETURN:   Returns a value less than 32 if error, else returns a value
  22. //           greater than 32 to indicate success.
  23.  
  24.  
  25. WinExec(CommandLine,WindowState)
  26. {
  27.    // WindowState is optional, so use default if it wasn't supplied
  28.    _WindowState = ( va_arg() < 2 ) ? SW_SHOWNORMAL : WindowState ;
  29.    // use DynamicLink to call the WinExec() routine.
  30.    return( DynamicLink("KERNEL","WINEXEC",SWORD16,PASCAL,CommandLine,_WindowState) );
  31. }
  32.  
  33.